<?php

use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;

class CreateCommoditysTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('commoditys', function (Blueprint $table) {
            $table->increments('commodity_id')->comment("商品ID,自增");
            $table->string('commodity_classify_ids')->comment("所属分类集合,逗号分割,1,2,3");
            $table->string('commodity_name',50)->comment("商品名字");
            $table->string('commodity_title',100)->comment("商品标题");
            $table->string('index_img_url')->nullable()->comment("商品首页图");
            $table->engine = 'InnoDB';
            $table->text('commodity_desc')->nullable()->comment("商品详情");
            $table->index('commodity_id');
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('commoditys');
    }
}
